package me.firstapp.module.weixin.cash;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.firstapp.module.base.BaseEntity;

@Entity
@Table(name = "CASH_APPLY")
public class CashApply extends BaseEntity {

	private static final long serialVersionUID = -4109868453722768558L;

	public static final int STATUS_APPLY = 0;
	public static final int STATUS_SH = 1;
	public static final int STATUS_WTG = 2;
	public static final int STATUS_FF = 3;

	public static final Map<Integer, String> statusMap = new HashMap<Integer, String>();
	static {
		statusMap.put(STATUS_APPLY, "申请中");
		statusMap.put(STATUS_SH, "审核中");
		statusMap.put(STATUS_WTG, "未通过");
		statusMap.put(STATUS_FF, "已通过");
	}

	@Column(name = "OPEN_ID", length = 40, nullable = false)
	private String openId;

	// 卡号
	@Column(name = "CARD_NO", length = 40, nullable = false)
	private String cardNo;

	// 申请编号
	@Column(name = "CASH_NO", length = 40, unique = true, nullable = false)
	private String cashNo;

	// 提现金额
	@Column(name = "CASH_AMOUNT", columnDefinition = "DECIMAL(11, 2)", nullable = false)
	private BigDecimal cashAmount;

	// 手续费
	@Column(name = "TRANSFER_FEE", columnDefinition = "DECIMAL(11, 2)", nullable = false)
	private BigDecimal transferFee;

	// 实际提现金额
	@Column(name = "ACTUAL_CASH_AMOUNT", columnDefinition = "DECIMAL(11, 2)", nullable = false)
	private BigDecimal actualCashAmount;

	// 状态：0申请，1审核中，2未通过，3发放
	@Column(name = "STATUS", columnDefinition = "TINYINT", nullable = false)
	private Integer status;

	// 申请时间
	@Column(name = "APPLY_TIME", columnDefinition = "DATETIME", nullable = false)
	private Date applyTime;

	// 审核时间
	@Column(name = "SH_TIME", columnDefinition = "DATETIME")
	private Date shTime;

	// 发放时间
	@Column(name = "TO_ACCOUNT_TIME", columnDefinition = "DATETIME")
	private Date toAccountTime;

	// 联系方式
	@Column(name = "CONTACT", length = 50, nullable = false)
	private String contact;

	// 真实姓名
	@Column(name = "REAL_NAME", length = 10, nullable = false)
	private String realName;

	// 支付宝帐号
	@Column(name = "ALI_ACCOUNT", length = 50, nullable = false)
	private String aliAccount;

	// 备注
	@Column(name = "REMARK", length = 40)
	private String remark;

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public BigDecimal getCashAmount() {
		return cashAmount;
	}

	public void setCashAmount(BigDecimal cashAmount) {
		this.cashAmount = cashAmount;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}

	public Date getToAccountTime() {
		return toAccountTime;
	}

	public void setToAccountTime(Date toAccountTime) {
		this.toAccountTime = toAccountTime;
	}

	public BigDecimal getTransferFee() {
		return transferFee;
	}

	public void setTransferFee(BigDecimal transferFee) {
		this.transferFee = transferFee;
	}

	public BigDecimal getActualCashAmount() {
		return actualCashAmount;
	}

	public void setActualCashAmount(BigDecimal actualCashAmount) {
		this.actualCashAmount = actualCashAmount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getCashNo() {
		return cashNo;
	}

	public void setCashNo(String cashNo) {
		this.cashNo = cashNo;
	}

	public Date getShTime() {
		return shTime;
	}

	public void setShTime(Date shTime) {
		this.shTime = shTime;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getAliAccount() {
		return aliAccount;
	}

	public void setAliAccount(String aliAccount) {
		this.aliAccount = aliAccount;
	}

}
